package chapter9;

public class BankAccount {

    int blance;//余额
    String AccountNum; //账号
    String name;   //账户名


    public BankAccount(String name,String accountNum,int blance){
        this.name=name;
        this.AccountNum=accountNum;
        this.blance=blance;
    }

    public void queryBalance(){
        System.out.println(name+"的账户余额为"+blance);
    }

    public void deposit (int money){
       blance+=money;
        System.out.println("你账户的余额为"+blance);
    }

    public void withdrawal(int money){
      if(blance>=money){
          System.out.println("取钱成功，你余额为："+(blance-money));
      }else{
          System.out.println("你的余额不足");
      }
    }







}
